import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;

public class demo10 {
    public static void main(String[] args) throws IOException {
      /*  try(Writer writer = new FileWriter("./test.txt",true)){//和前面outputStream一样,这里会进覆写,要想追加写,加上true
            char[] chars ={'a','b','c','d','e'};
            writer.write(chars);

        }*/
        try(Writer writer = new FileWriter("./test.txt",true)){//和前面outputStream一样,这里会进覆写,要想追加写,加上true
            BufferedWriter bufferedWriter = new BufferedWriter(writer);//相当于本来是没有缓冲区的,套上一层后write操作就有缓冲区了--相当于对write进行了扩容
            char[] chars ={'a','b','c','d','e'};
                bufferedWriter.write(chars);
        }
    }
}
